# Maintainer: Joaquín I. Aramendía <samsagax at gmail dot com>

pkgname=gamescope-session-sk-git
_gitdir=gamescope-session
pkgver=0.1.0.r0.g6662d15
pkgrel=1
pkgdesc="Common gamescope session files"
arch=('any')
url="https://github.com/ChimeraOS/gamescope-session"
license=('MIT')
provides=('gamescope-session-git')
conflicts=('gamescope-session-git')
groups=()
depends=('gamescope' 'read-edid')
makedepends=('git')
install=gamescope-session.install
source=("${_gitdir}::git+https://gitee.com/honjow/${_gitdir}.git#branch=dev")
md5sums=('SKIP')

pkgver() {
	cd "$srcdir/${_gitdir}"

	# Git, no tags available
	# printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}

package() {
	cd "$srcdir/${_gitdir}"
	cp -r ${srcdir}/${_gitdir}/usr ${pkgdir}/usr
	install -Dm644 ${srcdir}/${_gitdir}/LICENSE ${pkgdir}/usr/share/licenses/${_gitdir}/LICENSE
}
